package com.mall.auth.controller;


import cn.hutool.core.bean.BeanUtil;
import com.mall.auth.entity.param.OauthClientDetailsAddParam;
import com.mall.auth.entity.po.OauthClientDetails;
import com.mall.auth.service.IOauthClientDetailsService;
import com.mall.common.entity.ResponseData;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author wuyijie
 * @since 2021-06-28
 */
@RestController
@RequestMapping("/oauthClientDetails")
@Api(value = "OauthClientDetailsController",tags = "认证中心，客户端控制层")
public class OauthClientDetailsController {

    @Autowired
    private IOauthClientDetailsService oauthClientDetailsService;

    public ResponseData add(@RequestBody OauthClientDetailsAddParam oauthClientDetailsAddParam) {
        OauthClientDetails oauthClientDetails = BeanUtil.toBean(oauthClientDetailsAddParam, OauthClientDetails.class);
        boolean save = oauthClientDetailsService.save(oauthClientDetails);
        return ResponseData.success(save);
    }

}
